package jwj8508.exexex;

import java.util.Scanner;

public class MovieMain {
	static char[] a = new char[10];
	public static void main(String[] args) {
		
		System.out.println("극장 예약 시스템");
		System.out.println("현재 예약 상태는 다음과 같습니다.");
		System.out.println("--------------------------------------------------------------------------");
		for (int i = 1; i <= 10; i++){
			System.out.print(i + "\t");
		}
		System.out.println("\n--------------------------------------------------------------------------");
		for (char b : a) {
			b = 'O';
			System.out.print(b + "\t");
		}
		System.out.println("\n--------------------------------------------------------------------------");
		
		System.out.println("좌석을 예약하세요 [0:종료]");
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		
		while (true) {
		
			System.out.println("현재 예약 상태는 다음과 같습니다.");
			System.out.println("--------------------------------------------------------------------------");
			for (int i = 1; i <= 10; i++){
				System.out.print(i + "\t");
			}
			System.out.println("\n--------------------------------------------------------------------------");
			
//				a[i] = 'O';
			
				switch (k) {
				case 0 :
					System.out.println("종료됩니다.");
					System.exit(0);				
				case 1:	a[0] = 'X';	break;
				case 2:	a[1] = 'X';	break;
				case 3:	a[2] = 'X';	break;
				case 4:	a[3] = 'X';	break;
				case 5:	a[4] = 'X';	break;
				case 6:	a[5] = 'X';	break;
				case 7:	a[6] = 'X';	break;
				case 8:	a[7] = 'X';	break;
				case 9:	a[8] = 'X';	break;
				case 10:a[9] = 'X';	break;
				}
			for (int i = 0; i <= 9; ++i) {
				System.out.print(a[i] + "\t");
			}				

			
			System.out.println("\n--------------------------------------------------------------------------");
			System.out.println("좌석을 예약하세요 [0:종료]");			
			k = sc.nextInt();
			}
		

	}
	
	
	

}
